﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="loudakalist.aspx.cs" Inherits="weixin.crm.loudakalist" %>

<!DOCTYPE html>
<html lang="en" style="overflow: hidden;">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>漏打卡信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" media="screen" href="css/style.css">
    <link rel="stylesheet" type="text/css" href="css/reset.css">
    <script src="css/jquery-2.1.0.min.js"></script>
    <script src="css/layui/layui.js" type="text/javascript"></script>
    <script src="css/float.js"></script>
    <script type="text/javascript">
        var form = null, layer = null, laytpl = null;
        $(function () {
            layui.use(['form', 'laytpl'], function () {
                form = layui.form, layer = layui.layer, laytpl = layui.laytpl;
                getdata();
            });
            var image = "";
            $(function () {
                var icon = $("#rfloat_ico");
                if (icon.size() == 0) {
                    icon = $("body").prepend("<span id=\"rfloat_ico\"><a href=\"/crm/loudakaAdd.aspx\"><img alt=\"\" src=\"" + image + "\" /></a></span>");
                    icon = $("#rfloat_ico");
                    icon.css({ width: 50, height: 50, display: "block", position: "fixed", "background-color": "#fff", left: "15px", bottom: "85px", "border-radius": "15px", "cursor": "pointer", "z-index": 9999999 });
                }
            });
        });
        function getdata() {
            $.ajax({
                url: "api.ashx?rnd=" + Math.random(),
                type: "POST",
                data: { Action: "loudakalist" },
                dataType: "json",
                success: function (data) {
                    if (data.success == true) {
                        var html = $("#tmpl").html();
                        var html = laytpl($("#templ").html()).render(data.data);
                        $("#bodycont").append(html);
                    }
                    else {
                        alert('请求失败,' + data.info);
                    }
                },
                error: function () {
                    alert('请求失败！');
                }
            });
        }
        function pingjia(type, id) {
            window["otype"] = type;
            window["oid"] = id;
            layer.open({
                type: 1,
                title: 0,
                closeBtn: 0,
                skin: 'yourclass',
                content: $("#dialog").html(),
                success: function (layero, index) {
                    $("#commt").val($("#dp_" + id).text().replace("点评内容:", ""));
                }
            });
        }
        function dianpingpost() {
            if ($("#commt").val()=="") {
                layer.alert('点评内容不能为空', { icon: 6 });
                return;
            }
            $.ajax({
                url: "api.ashx?rnd=" + Math.random(),
                type: "POST",
                data: { Action: "postworkslist", type: window["otype"], id: window["oid"], commt: $("#commt").val() },
                dataType: "json",
                success: function (data) {
                    if (data.success == true) {
                        $("#dp_" + window["oid"]).text("点评内容:" + $("#commt").val());
                        layer.closeAll();
                        layer.alert('点评成功', { icon: 6 });
                    }
                    else {
                        layer.alert('点评失败,'+data.info, { icon: 6 });
                    }
                },
                error: function () {
                    layer.alert('点评发生错误', { icon: 6 });
                    return;
                }
            });
        }
    </script>
    <script id="dialog" type="text/html">
        <p style="width:100%;"><textarea id="commt" maxlength="2000" style="width:300px;height:160px;display:block;padding:15px;margin: 3px auto;border:solid 1px #ccc;resize:none;"></textarea></p>
        <p style="width:100%;text-align:right;"><button onclick="layer.closeAll();" style="margin-right:15px;padding:5px 10px;">关闭</button><button onclick="dianpingpost()" style="margin-right:15px;padding:5px 10px;">点评</button></p>
    </script>
    <style>
        .yourclass {
            overflow:hidden;
            width:360px;
        }
        .item {
            width: 100%;
            height: auto;
            background-color: #9cbade;
            margin-top:8px;
            margin-left: auto;
            border-radius:10px;
            padding:10px;
            box-sizing:border-box;  
            -moz-box-sizing:border-box; /* Firefox */  
            -webkit-box-sizing:border-box; /* Safari */ 
        }
        .item table{
            width: 90%;
            margin:0 auto;
        }
        .item td{
            border: solid 1px #8a5a5a;
            font-size: 15px;
            padding: 5px;
        }
    </style>
</head>
<body style="overflow: auto;position: relative;">
    <div style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 999;overflow: auto;" id="bodycont"></div>
    <div id="particles-js">
        <div class="sk-rotating-plane"></div>
        <canvas class="particles-js-canvas-el" style="width: 100%; height: 100%;" width="1920" height="917"></canvas>
    </div>
</body>
</html>
<script id="templ" type="text/html">
    {{#  layui.each(d, function(index, item){ }}
    <div class="item">
        <table>
            <tr class="head">
                <td style="width:50%;">部门：{{item.department_name}}</td><td style="width:50%;">员工：{{item.employee_name}}</td>
            </tr>
            <tr>
                <td colspan="2">漏打卡时间：{{item.date}}</td>
            </tr>
            <tr>
                <td colspan="2"><pre style="white-space:pre-wrap;word-wrap:break-word;font-weight: 600;">{{item.reason}}</pre></td>
            </tr>
            <tr>
                <td colspan="2"><span style="color: #075ba5;border: 1px solid #eee;padding: 1px 5px;border-radius: 3px;font-size: 13px;" onclick="javascript:$(this).closest('tr').next('.attach').toggle();">查看附件</span></td>
            </tr>
            <tr class="attach" style="display:none;">
                <td colspan="2"><img style="width:100%;height:auto;" alt="" src="<%=weixin.crm.basepage.Domain%>{{item.attach}}" /></td>
            </tr>
            <tr>
                <td colspan="2">部门主管审核：{{item.bmcheckinfo}}</td>
            </tr>
            <tr>
                <td colspan="2">行政财务审核：{{item.cwcheckinfo}}</td>
            </tr>
        </table>
    </div>
    {{#  }); }}
</script>